package com.shiwaixiangcun.monitor.scheduler;

import com.shiwaixiangcun.core.utils.MonkeyUtils;
import com.shiwaixiangcun.core.utils.SpringUtils;
import com.shiwaixiangcun.monitor.service.WorkOrderTimeoutRuleService;
import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by Administrator on 2017/11/30.
 */
@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class WorkOrderTimeOutJob implements Job {

    private static final Logger LOGGER = LoggerFactory.getLogger(WorkOrderTimeOutJob.class);

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {

        LOGGER.debug("*****  Start execute WorkOrderTimeOutJob [{}]");
        WorkOrderTimeoutRuleService workOrderTimeoutRuleService = SpringUtils.getBean(WorkOrderTimeoutRuleService.class);

        if (MonkeyUtils.isNotEmpty(workOrderTimeoutRuleService)) {
            workOrderTimeoutRuleService.execTimeOutJob();
        }
        LOGGER.debug("&&&&&  End execute WorkOrderTimeOutJob [{}]");
    }


}
